import * as Mongoose from 'mongoose';
import { Schema } from 'mongoose';
import { MongooseFactory } from '../kalend';

const schema = MongooseFactory.Schema({
    /** 角色名称 */
    name: {
        type: String,
        required: true//必填
    },
    /**角色值 1.餐厅负责人 2.品牌宣传大使  64.平台系统管理员 */
    type: {
        type: Number,
        default: 2
    },
    //是否内置角色
    isInternal: {
        type: Boolean,
        default: false
    },
    rights: [{
        type: Mongoose.Schema.Types.ObjectId,
        ref: "menu",
        required: true
    }],
    /**描述信息 */
    description: String
});

/**
 * 
 */
export const roleModel = MongooseFactory.Model("role", schema);
